<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .container{
            width: 100%;
            background-color: rgb(236, 231, 221);
        }
        .cart{
            width: 450px;
            margin:auto;
        }
        .cart .title, .cart .total{
            width: 100%;
            height: 35px;
            line-height: 35px;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 20px;
            background-color: rgb(85, 204, 252);
        }
        /* ----------- */
        .cart .total{
            background-color: rgb(253, 193, 81);
            display: block;
            text-align: right;
            font-size: 15px;
            color: rgb(243, 59, 26);
        }
        .cart .total button{
            margin-right: 20px;
            background-color: orangered;

        }
        /* ------------ */
        .item{
            width: 100%;
            height: 40px;
            background-color: rgb(255, 255, 250);
            display: flex;
            align-items: center;
        }
        .item img{
            width: 20%;
            height: 36px;
            margin:0 5px;
        }
        .item .name{
            font-size: 19px;
            margin: 0 5px;
        }
        .change div{
            display: flex;
            justify-content: center;
            align-items: center;
            align-items: center;
            float: left;
            width: 14px;
            height: 14px;
            margin: 8px 0;
            background-color: rgb(179, 179, 179);
            text-decoration: none;
        }
        .change input{
            display: block;
            float: left;
            width: 44px;
            height: 14px;
            margin: 4px 0;
        }
        .del{
            display: flex;
            justify-content: center;
            align-items: center;
            align-items: center;
            font-size: 30px;
            width: 30px;
            height: 30px;
            line-height: 30px;
            background-color: lightcoral;
        }
    </style>
</head>

<body>
    <div id="app">
        <div class="container">
            <div class="cart">
                <my-cart></my-cart>
            </div>
        </div>
    </div>

    <script src="../../js/vue.js"></script>
    <script>
        var CartTitle = {
            template:`
                <div class="title">我的商品</div>
            `
        }
        var CartList = {
            template:`
            <div>
                <div class="item">
                    <img src="../../img/test/11.jpg"/>
                    <div class="name">zhofe</div>
                    <div class="change">
                        <div href="">-</div>
                        <input type="text" class="num"/>
                        <div href="">+</div>
                    </div>
                    <div class="del">x</div>
                </div>
            </div>
            `
        }
        var CartTotal = {
            template:`
                <div class="total">
                    <span>总价：123</span>
                    <button>结算</button>
                </div>
            `
        }
        Vue.component('my-cart', {
            template:`
                <div class="cart">
                    <cart-title></cart-title>
                    <cart-list></cart-list>
                    <cart-total></cart-total>
                </div>
            `,
            components: {
                'cart-title': CartTitle,
                'cart-list': CartList,
                'cart-total': CartTotal
            }
        })
        var vm = new Vue({
            el: '#app',

        })
    </script>
</body>

</html>